package com.eda.commous.excecption;

import com.eda.commous.http.ApiError;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;

@Data
@NoArgsConstructor
public class FLowException extends RuntimeException {
    private String error;
    private String message;
    private HttpStatus status;

    public FLowException(String error, String message) {
        super(message);
        this.error = error;
        this.message = message;
        this.status = HttpStatus.BAD_REQUEST;
    }

    public ApiError getApiError() {
        return new ApiError(message).error(error);
    }
}


